package com.ty.provider;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectProvider {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String msg)
    {
        // 发送信息
        rabbitTemplate.convertAndSend( "Direct-ex","rk01", msg);
        System.out.println("发送信息: " + msg);
    }
}
